
export default {
    // 获取请求头
    get(key: string) {
        if (!localStorage.getItem(key)) {
            return
        }
        return JSON.parse(localStorage.getItem(key)||"")
    },
    // 添加请求头
    set(key: string, value: any) {
        localStorage.setItem(key, JSON.stringify(value));
    },
    // 清除某一条数据
    remove(key:string) {
        localStorage.removeItem(key);
    },
    // 清空数据
    clear() {
        localStorage.clear();
    }
}